package com.zero.stream.reduce;

import com.zero.analy.PindaoRD;
import org.apache.flink.api.common.functions.ReduceFunction;
import org.apache.flink.api.java.tuple.Tuple2;

public class PindaoReduce implements ReduceFunction<PindaoRD> {

    @Override
    public PindaoRD reduce(PindaoRD value1, PindaoRD value2) throws Exception {
        PindaoRD pindaoRD = new PindaoRD();
        pindaoRD.setPingdaoid(value1.getPingdaoid());
        pindaoRD.setCount(value1.getCount() + value2.getCount());
        return pindaoRD;
    }
}
